#!/bin/bash

# GENERAL CONFIGURATION #
DUMP_DST=/root/
PROJECT_NAME=yaoqingka
PROJECT_BASE=/root/
DTE="`date +%Y-%m-%d`"
DUMP=${DUMP_DST}yaoqingka.$DTE.tar.gz

# DB CONFIGURATION #
DB=yaoqingka
DBDUMP=yaoqingka.db.sql

cd $PROJECT_BASE

`mysqldump -u root -p $DB > $DBDUMP` || exit 1

tar -zcvpf $DUMP $PROJECT_NAME $DBDUMP --exclude="*${PROJECT_NAME}/library/Zend*" || exit 2

rm $DBDUMP || exit 3

exit 0